﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
    public class PhieuNhap_DAO
    {
        clsDocSQL m_clsDocSQL = new clsDocSQL();
        public int ThemPhieuNhap(PhieuNhap_DTO dto)
        {
            SqlParameter[] m_SqlParameter = new SqlParameter[4];
            m_SqlParameter[0] = new SqlParameter("@MaPhieuNhap", dto.Str_MaPhieuNhap);
            m_SqlParameter[1] = new SqlParameter("@NgayLap", dto.D_NgayLap);
            m_SqlParameter[2] = new SqlParameter("@MaNV", dto.Str_MaNV);
            m_SqlParameter[3] = new SqlParameter("@KQ", 0);
            m_SqlParameter[3].Direction = ParameterDirection.Output;
            int KQ = m_clsDocSQL.Insert_Delete_Update("sp_ThemPN", m_SqlParameter);
            return KQ;
        }
        public string MaPhieuNhapTang()
        {
            return m_clsDocSQL.DocKieuString("MaPhieuNhap_Tang");
        }
    }
}
